package com.kuangjia.conferenceroomrental.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kuangjia.conferenceroomrental.entity.Room;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 会议室 Mapper 接口
 */
@Mapper
public interface RoomMapper extends BaseMapper<Room> {
    
    /**
     * 查询所有可用会议室
     * 
     * @return 可用会议室列表
     */
    @Select("SELECT * FROM rooms WHERE status = 'AVAILABLE'")
    List<Room> selectAvailable();
    
    /**
     * 查询容纳人数大于等于指定人数的会议室
     * 
     * @param capacity 容纳人数
     * @return 会议室列表
     */
    @Select("SELECT * FROM rooms WHERE capacity >= #{capacity}")
    List<Room> selectByCapacity(@Param("capacity") Integer capacity);
} 